///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
#ifndef __CONTAINER_H__
#define __CONTAINER_H__

#include <Config.h>
#include <vector>

//-----------------------------------------------------------------------------

class Container
{
public:
	/*
	*	Constructor - destructor
	*/
							Container();
	virtual					~Container();

	/*
	*	Draw
	*/
	void					Update(f32 dt);
	void 					Draw();

	/*
	*	Size - position
	*/
	void					SetPosition(s16 x, s16 y);
	void					Move(s16 x, s16 y);
	void					SetSize(s16 width, s16 height);
	void					SetX(s16 x);
	void					SetY(s16 y);
	void					SetWidth(s16 width);
	void					SetHeight(s16 height);
	s16						GetX();
	s16						GetY();
	s16						GetAbsX();
	s16						GetAbsY();
	s16						GetWidth();
	s16						GetHeight();

	/*
	*	Child-parent hierarchy
	*/
	Container*				GetParent();
	void					SetParent(Container* parent);
	void					AddChild(Container* child);
	void					UpdateFromChild(Container* child);
	void					UpdateFromParent();
	Container*				GetContainerAt(s16 x, s16 y);
	
private:

	void					UpdateChildren();

	s16							m_posX;
	s16							m_posY;
	s16							m_width;
	s16							m_height;
	s16							m_absPosX;
	s16							m_absPosY;

	u8							m_color[4];

	Container*					m_parent;
	std::vector<Container*>		m_children;

};

#endif // __CONTAINER_H__
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
